package com.puppy.utils;


public class ThreadLocalUtils {

    //线程变量，用来共享用户id
    private static final ThreadLocal<Integer> CURRENT_LOCAL = new ThreadLocal<>();

    public static void setCurrentLocal(Integer userId) {
        CURRENT_LOCAL.set(userId);
    }

    public static Integer getCurrentLocal() {
        return CURRENT_LOCAL.get();
    }

    public static void removeCurrentLocal() {
        CURRENT_LOCAL.remove();
    }


}
